<?php
namespace app\datamanage\model;
use think\Model;

class Jren extends Model
{
    //显示页面
    function showJren($condition='')
    {
        if(!$condition){
            $res = db('jiangren')->field('id, name, score,teacase_id, teaarea_id, briefintro, bangdan_id, detailintro, biography,click')->order('score desc')->select();
            return $res;
        }
        $res = db('jiangren')->field('id, name, score,teacase_id, teaarea_id, bangdan_id, briefintro, detailintro,biography,click')->where($condition)->order('score desc')->select();
        return $res;
    }

    function updateAll($id, $score)
    {
        $data = ["score"=>$score];
        db('jiangren')->where("id", $id)->update($data);
    }

    //返回某茶类对应的产地
    function reTeaArea($teacase_id)
    {
       $res = db("case_area")->field("teaarea_id")->where("teacase_id",$teacase_id)->select();
       return $res;
    }









}










 ?>